**************************
***	RUN USING STATA 16 ***
**************************

* Purpose: Master do file. All files can be executed from here.
* Last Updated: 20APR2023

	clear all
	set maxvar 32767

*** Use your own file path

	*global root 		"ROOT DIRECTORY GOES HERE"	

	global dofile		"$root/do"
	global input 		"$root/input"
	global output 		"$root/output"
	global table		"$root/output/table"
	global graph		"$root/output/graph"
	cd "$root"
	
*** Add programs
	*search renvars
	*ssc install uirt
	
***********************
**** DATA CLEANING ****	
***********************
	
*** Converting English 
	run "$dofile/01 english convert to WAEC.do"

*** Combining maths objective & subjective
	run "$dofile/02 math combine.do"		
	
*** Converting Maths
	run "$dofile/03 math convert to WAEC.do"

***********************
******* ANALYSIS ******
***********************

*** English CTT
	// Outputs: Table 2, English
	run "$dofile/04 english ctt.do"

*** Maths CTT
	// Outputs: Table 2, Maths
	run "$dofile/05 math ctt.do"

*** Maths IRT (objective)
	// Outputs: Online Appendix ICCs
	run "$dofile/06 math irt (objective).do"

*** Maths IRT (subjective)
	//Outputs: Online Appendix ICCs
	run "$dofile/07 math irt (subjective).do"

*** Maths distribution
	run "$dofile/08 math distribution.do"

*** Maths decomposition
	//Outputs: Figure 3b, Table 4
	run "$dofile/09 decomposition.do"
	
*** Maths difficulty-adjusted trends
	//Outputs: Figure 3a
	run "$dofile/10 difficulty adjusted trends.do"	

*** Comparison between WASSCE and study results
	//Outputs: Figure 2 and Figure 4
	run "$dofile/11 WAEC compare.do"	
	
*** Difficulty-induced pass rates for other WASSCE countries
	//Outputs: Figure 5
	run "$dofile/12 simulate_gmb_nga.do"		
	
*** WASSCE item coverage
	//Outputs: Figure 1
	run "$dofile/13 domain analysis.do"
	
*** Ghana labor returns
	//Outputs: Table 5
	run "$dofile/14 labor returns.do"	
	
	
	

